package com.ces.knacky.model;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractChildEntity;

/** @author Hibernate CodeGenerator */
public class AuctionItem extends AbstractChildEntity  implements Serializable {

    /** persistent field */
    private com.ces.knacky.model.Auction auction;

    /** persistent field */
    private com.ces.knacky.model.Item item;

    /** full constructor */
    public AuctionItem(com.ces.knacky.model.Auction auction, com.ces.knacky.model.Flag flag, com.ces.knacky.model.Item item) {
        this.auction = auction;
        this.flag = flag;
        this.item = item;
    }

    /** default constructor */
    public AuctionItem() {
    }
    public com.ces.knacky.model.Auction getAuction() {
        return this.auction;
    }

    public void setAuction(com.ces.knacky.model.Auction auction) {
        this.auction = auction;
    }

    public com.ces.knacky.model.Item getItem() {
        return this.item;
    }

    public void setItem(com.ces.knacky.model.Item item) {
        this.item = item;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof AuctionItem) ) return false;
        AuctionItem castOther = (AuctionItem) other;
        return new EqualsBuilder()
            .append(this.getItem().getId(), castOther.getItem().getId()).append(this.getAuction().
             getId(), castOther.getAuction().getId())
            .isEquals();
    }

}
